<template>
    <div class="dispatch-control">
        <div class="list-tab-w">
            <el-cascader
                    placeholder="请选择司机"
                    :options="CompanyData"
                    filterable
                    change-on-select
            ></el-cascader>
        </div>
    </div>
</template>

<script>
    export default {
        name: "DispatchControl",
        data() {
            return{
                companyDriver: '',
                CompanyData: []
            }
        },
        mounted() {
            this.getCompanyData();
        },
        methods: {
            getCompanyData() {
                this.$http.get('user/driver/tree')
                    .then((res) => {
                        this.CompanyData = res.data.data;
                    })
                    .catch((error) => {
                        if (error.response.data.msg) {
                            this.$message.error(error.response.data.msg);
                        } else {
                            this.$message.error('请求错误：' + error.response.status);
                        }
                    });
            }, // 获取连队信息
        }
    }
</script>

<style scoped lang="less">
.dispatch-control{
    .list-tab-w{
        width: 140px;
        margin-right: 10px;
        border: 1px solid #D8DCE6;
    }
}
</style>
